//
//  +TP.h
//  Tripvi
//
//  Created by xiaowuxiaowu on 2017/5/11.
//  Copyright © 2017年 xiaowuxiaowu. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface  UISearchBar(TP)

@property (copy, nonatomic) BOOL (^shouldBegindEditingBlock)(UISearchBar *earchBar);
@property (copy, nonatomic) BOOL (^shouldEndEditingBlock)(UISearchBar *earchBar);
@property (copy, nonatomic) void (^didBeginEditingBlock)(UISearchBar *earchBar);
@property (copy, nonatomic) void (^didEndEditingBlock)(UISearchBar *earchBar);
@property (copy, nonatomic) BOOL (^shouldChangeCharactersInRangeBlock)(UISearchBar *earchBar, NSRange range, NSString *replacementString);
@property (copy, nonatomic) BOOL (^shouldCannelBlock)(UISearchBar *earchBar);
@property (copy, nonatomic) BOOL (^shouldClearBlock)(UISearchBar *earchBar);
@property (copy, nonatomic) void (^buttonClickBlock)(UISearchBar *earchBar);
@property (copy, nonatomic) void (^textDidChangeBlock)(UISearchBar *searchBar,NSString *searchText);


- (void)setShouldBegindEditingBlock:(BOOL (^)(UISearchBar *earchBar))shouldBegindEditingBlock;
- (void)setShouldEndEditingBlock:(BOOL (^)(UISearchBar *earchBar))shouldEndEditingBlock;
- (void)setDidBeginEditingBlock:(void (^)(UISearchBar *earchBar))didBeginEditingBlock;
- (void)setDidEndEditingBlock:(void (^)(UISearchBar *earchBar))didEndEditingBlock;
- (void)setShouldChangeCharactersInRangeBlock:(BOOL (^)(UISearchBar *earchBar, NSRange range, NSString *string))shouldChangeCharactersInRangeBlock;
- (void)setShouldClearBlock:(BOOL (^)(UISearchBar *earchBar))shouldClearBlock;
- (void)setShouldCannelBlock:(BOOL (^)(UISearchBar *earchBar))shouldReturnBlock;
- (void)setButtonClickBlock:( void(^)(UISearchBar *earchBar))shouldReturnBlock;
- (void)setTextDidChangeBlock:(void (^)(UISearchBar *searchBar,NSString *searchText))barTextDidEndEditingBlock;


-(void)tp_setupSearchBarPlaceholder:(NSString *)placeholder;
@end
